package com.kamistoat.meimeimall.meimeimallcoupon.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.kamistoat.meimeimall.common.annotation.DubboAndHTTPExceptionCatch;
import com.kamistoat.meimeimall.common.annotation.LoginRequired;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.kamistoat.meimeimall.meimeimallcoupon.entity.CouponSpuRelationEntity;
import com.kamistoat.meimeimall.meimeimallcoupon.service.CouponSpuRelationService;
import com.kamistoat.meimeimall.common.utils.R;


/**
 * 优惠券与产品关联
 *
 * @author kamistoat
 * @email linjianshanke@163.com
 * @date 2021-09-12 16:19:47
 */
@Api(tags="优惠券-产品关联数据库操作")
@RestController
@RequestMapping("couponspurelation")
public class CouponSpuRelationController {
    @Autowired
    private CouponSpuRelationService couponSpuRelationService;

    /**
     * 列表
     */
    @ApiOperation("从数据库获取列表")
    @GetMapping("/list")
    @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R list(@RequestParam Map<String, Object> params) {
        return R.ok();
    }


    /**
     * 信息
     */
    @ApiOperation("从数据库查询指定的POJO")
    @GetMapping("/coupon_spu_relation_info")
    @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R info(@RequestParam("id") Long id) {
        return R.ok();
    }

    /**
     * 保存
     */
    @ApiOperation("向数据库保存POJO")
    @PutMapping("/coupon_spu_relation_info")
    @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R save(@RequestBody CouponSpuRelationEntity couponSpuRelation) {

        return R.ok();
    }

    /**
     * 修改
     */
    @ApiOperation("向数据库更新POJO")
    @PostMapping("/coupon_spu_relation_info")
    @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R update(@RequestBody CouponSpuRelationEntity couponSpuRelation) {
        return R.ok();
    }

    /**
     * 删除
     */
    @ApiOperation("从数据库删除指定优惠券")
    @DeleteMapping("/coupon_spu_relation_info")
    @LoginRequired
    @DubboAndHTTPExceptionCatch
    public R delete(@RequestBody Long[] ids) {
        return R.ok();
    }

}
